moduleAplicacao = angular.module('aplicacao', ['ui.mask', 'ui.validate']);

moduleAplicacao.controller("init", function($scope, $compile, $window) {

    var ng = $scope.ctrl_init = {};
    
    var loadBundles = function(lang) {
        jQuery.i18n.properties({
            name: 'BundleResource',
            path: '../app/config/bundle/',
            mode: 'both',
            language: lang,
            callback: function() {

            }
        });
    };

    loadBundles('pt_BR');
    
    $scope.getProperty = function(key, params) {
        if (params) {
            var funcao = "jQuery.i18n.prop(key";
            $.each(params, function(index, value) {
                funcao += ",'" + value + "'";
            });
            funcao += ")";

            return eval(funcao);
        } else {
            return jQuery.i18n.prop(key);
        }
    };
    
});